package com.kata.chapter6;

import java.io.UnsupportedEncodingException;

/**
 * Created by Solidsnake on 2014/11/20.
 */
public class Main {

    public static void main(String[] args) throws UnsupportedEncodingException {

        FileReadProcess process = null;
        byte[] bytes = null;

        System.out.println("我现在要读取TXT文件");

        process = new FileReadProcess(new TxtFileReader());
        bytes = process.readFile();
        System.out.println(new String(bytes, "UTF-8"));

        System.out.println("====================");

        System.out.println("我现在要读取HEX文件");

        process = new FileReadProcess(new HexFileReader());
         bytes = process.readFile();
        System.out.println(new String(bytes, "UTF-8"));

        System.out.println("====================");

        System.out.println("我现在要读取PBF文件");

        process = new FileReadProcess(new PBFFileReader());
        bytes = process.readFile();
        System.out.println(new String(bytes, "UTF-8"));

        System.out.println("====================");
    }
}
